<?php
Class DB{
	static $db;
	static function get(){
		return self::$db;
	}
	static function set($db){
		self::$db = $db;
	}
	static function query($sql="",$array=array()){
		if($sql!=""){
			$p = self::$db->prepare($sql);
			$p->execute($array);
			return $p->fetchAll(PDO::FETCH_ASSOC);
		}
	}
	static function exec_($sql=""){
		if($sql!=""){
			$p = self::$db->prepare($sql);
			return $p->execute();
		}
	}
}

?>